package com.runfast.common.utils;

import com.auth0.jwt.JWT;
import com.auth0.jwt.interfaces.Claim;

import static com.auth0.jwt.JWT.decode;

public class TokenUtil1 {
    public final static String TOKEN="token";
    public final static String SCRETE="wdptkc88";
    public final static String ISSUER = "runfast";
    public final static String SHOPPER_ID = "shopperId";

    public static Integer getShopperId(String token) {

        JWT decode = decode(token);
        Claim claim = decode.getClaim(TokenUtil1.SHOPPER_ID);
        Integer shopperId = claim.asInt();
        return shopperId;
    }
}
